package com.ruoyi.basedata.api.factory;

import com.ruoyi.basedata.api.RemoteCustomerService;
import com.ruoyi.basedata.domain.CustomerUtil;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.basedata.Customer;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteCustomerFallBackFactory implements FallbackFactory<RemoteCustomerService> {

    @Override
    public RemoteCustomerService create(Throwable cause) {
        return new RemoteCustomerService() {
            @Override
            public R<CustomerUtil> selectCustomerByName(String name, String source) {
                return R.fail("请求失败");
            }
        };
    }
}
